package com.fi.recogn.exec;

import com.fi.common.domain.vo.FileData;
import com.fi.common.domain.vo.FileDataHtml;
import com.fi.recogn.AbstractRecogn;
import com.fi.recogn.util.FileTypeUtil.FileType;
import org.springframework.stereotype.Component;
import org.springframework.util.StopWatch;

import static com.fi.recogn.util.FileTypeUtil.FileType.HTML;

/**
 * @Description TODO html识别器
 * @Author lujiahong
 * @Date 2024/8/12 14:10
 */
@Component
public class HtmlRecogn extends AbstractRecogn<FileDataHtml> {
    public HtmlRecogn() {
        super(HtmlRecogn.class.getSimpleName(),new StopWatch());
    }

    @Override
    public FileData recogn(FileDataHtml data) {
        super.startLog(data);
        FileData fileData = super.ossService.parseHtmlFile(data);
        super.endLog(data);
        return fileData;
    }

    @Override
    public FileType getFileType() {
        return HTML;
    }
}